<?php
class newreply_Controller extends GlobalAction {
	public $__default = 'AJAX';
	
	public function proceedAJAX () {
		if(!empty($_POST['text'])) {
			$params = xine::$model->newReply($_POST, 'display:none');
			
			echo json_encode(array('status' => 'ok', 'text' => xine::$view->getReply($params), 'id' => $params['id']));
		} else {
			echo json_encode(array('status' => 'fuck', 'msg' => xine::$model->error()));
		}
	}
}